< previous page page_497 next page >

Page 497
17. Check the Microsoft ActiveX Data Objects 2.0 Library option.
18. Click the OK button.
analysis.gifYou have now started the process of getting rid of all the data aware controls, so you can add regular controls and program those using ADO.

Sub Main()
Create a Sub Main() procedure to open a global Connection object prior to opening the data entry form. This increases the performance of the application when creating recordsets, because it doesnt need to open a connection every time. Of course you are now using up more resources in the database server if you are using one. If you are just using an Access database, then there is no great amount of overhead.
9f31265bb40b592b1929e18a47ab28e5.gif
Public Sub Main()
   Dim boolPerform As Boolean

   Screen.MousePointer = vbHourglass

   ' Open the Database Engine
   boolPerform = DataOpen(goConn)

   If boolPerform Then
      frmEmployee.Show
   End If

   Screen.MousePointer = vbDefault
End Sub
Now that you have a Connection object established, you can create as many Recordset objects from that connection as you want.
9f31265bb40b592b1929e18a47ab28e5.gif
TIP
Create a public
Connection object to speed up the creation of Recordset objects.

 
< previous page page_497 next page >

If you like this book, buy it!